package top.mccat.filesystem.utils.checker;

public class AccountCheckUtils {

    //账号正则，5-10位，只能为纯数字，不允许0开头
    public static final String NAME_CHECKER = "[1-9][0-9]{4,9}";
    //密码正则(字母开头，允许5-16字节，允许字母数字下划线)：
    public static final String PASSWORD_CHECKER = "^[a-zA-Z][a-zA-Z0-9_]{7,15}$";

    /**
     * 用户名验证
     * @param name
     * @return
     */
    public static boolean nameChecker(String name){
        return name.matches(NAME_CHECKER);
    }

    /**
     * 密码验证
     * @param password
     * @return
     */
    public static boolean passwordChecker(String password){
        return password.matches(PASSWORD_CHECKER);
    }
}
